/*  yALB - Yet Another List Builder (roster Editor for Wargames/tabletop games).
    Copyright (C) 2008-2012  Daniel Ricardo Castro Alvarado

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.*/

#ifndef FILESTRUCTS_H
#define FILESTRUCTS_H

#include "collections/categorycollection.h"
#include "collections/columncollection.h"
#include "collections/propertycollection.h"
#include "collections/optioncollection.h"
#include "collections/itemcollection.h"
#include "collections/globaltextcollection.h"
#include "collections/unitcollection.h"

class GameFileStructs {
public:
    CategoryCollection *itemCategories;
    CategoryCollection *optionCategories;
    CategoryCollection *unitCategories;
    ColumnCollection *columns;
    PropertyCollection *itemProperties;
    PropertyCollection *optionProperties;
    PropertyCollection *unitProperties;
    ItemCollection *items;
    OptionCollection *options;
    GlobalTextCollection *globalTexts;

    GameFileStructs() : itemCategories(NULL), optionCategories(NULL), unitCategories(NULL),
        columns(NULL), itemProperties(NULL), optionProperties(NULL), unitProperties(NULL),
        items(NULL), options(NULL), globalTexts(NULL) { }

    void setShowMessages(bool value);
    void clearAll();
};

class ArmyFileStructs {
public:
    CategoryCollection *unitCategories;
    CategoryCollection *itemCategories;
    CategoryCollection *optionCategories;
    OptionCollection *options;
    ItemCollection *items;
    UnitCollection *units;
    GlobalTextCollection *globalTexts;

    QHash<QString, InheritedCategoryData > *inheritedUnitCategoryData;
    QHash<QString, InheritedCategoryData > *inheritedItemCategoryData;
    QHash<QString, InheritedCategoryData > *inheritedOptionCategoryData;
    QHash<QString, InheritedItemData > *inheritedItemData;
    QHash<QString, InheritedOptionData> *inheritedOptionData;

    ArmyFileStructs() : unitCategories(NULL), itemCategories(NULL), optionCategories(NULL),
        options(NULL), items(NULL), units(NULL), globalTexts(NULL),
        inheritedUnitCategoryData(NULL), inheritedItemCategoryData(NULL),
        inheritedOptionCategoryData(NULL), inheritedItemData(NULL),
        inheritedOptionData(NULL) { }

    void setShowMessages(bool value);
    void clearAll();
};

class GameFileData {
public:
    CategoryCollection itemCategories;
    CategoryCollection optionCategories;
    CategoryCollection unitCategories;
    ColumnCollection columns;
    PropertyCollection itemProperties;
    PropertyCollection optionProperties;
    PropertyCollection unitProperties;
    ItemCollection items;
    OptionCollection options;
    GlobalTextCollection globalTexts;

    GameFileStructs toGameFileStructs();
};

class ArmyFileData {
public:
    CategoryCollection unitCategories;
    CategoryCollection itemCategories;
    CategoryCollection optionCategories;
    OptionCollection options;
    ItemCollection items;
    UnitCollection units;
    GlobalTextCollection globalTexts;

    ArmyFileStructs toArmyFileStructs();
};

#endif // FILESTRUCTS_H
